#ifndef __LOGIN_PAGE_H__
#define __LOGIN_PAGE_H__

#include <QCloseEvent>
#include <QLineEdit>
#include <QDebug>
#include <ElaWidget.h>

class LoginPage : public ElaWidget
{
    Q_OBJECT
public:
    explicit LoginPage(QWidget* parent = nullptr);
    ~LoginPage();

    void SignIN();
    void Paras(QString Account = "",QString Password = "");
    void Xiaoxi();

    int flag = 0;
    // TODO: set in main page
    QString Name;
    QString Acc;
    QLineEdit *LEdit0;
    QLineEdit *LEdit1;
    const QString filePath{"./../../../Account"};
signals:
    void flagChangedSignal();
    void windowClosed();
private:
    void closeEvent(QCloseEvent *event) override
    {
        emit windowClosed();  // 发射关闭信号
        qDebug()<<"关闭信号已发出";
        event->accept();      // 允许子窗口正常关闭
        QWidget::closeEvent(event); 
    };
};

#endif // __LOGIN_PAGE_H__
